#include<stdio.h>
#include<assert.h>

char * strcat(char * dest, const char * src) { 
	assert(dest!=NULL && src != NULL);
	char *tmp = dest; 
	while (*dest != '\0') dest++;
	while((*dest++=*src++)!='\0');
		return tmp;
		/*
			while(*dest != '\0'){
					&dest++ = *src++;
				}
			*dest = *src;
		*/
}

int strcmp(const char * cs,const char * ct) {
	register signed char __res;
	assert(cs!=NULL && ct != NULL);
	while (1) {                   
	if ((__res = *cs - *ct++) != 0 || !*cs++) break;     
	}  
	return __res;
 }
int main(){
	char str[10],str1[10],str3[10];
	char* pStr = fgets(str,10,stdin);
	char* pStr1 = fgets(str1,10,stdin);
	char* pStr3 = fgets(str3,10,stdin);
	printf("str = %s\n",strcat(pStr,pStr1));
	printf("return %d\n",strcmp(pStr,pStr1));
	printf("return %d\n",strcmp(pStr,pStr3));
}
